window.requestAnimationFrame = (function(){
    return  window.requestAnimationFrame       ||
            window.webkitRequestAnimationFrame ||
            window.mozRequestAnimationFrame    ||
            window.oRequestAnimationFrame      ||
            window.msRequestAnimationFrame     ||
            function (callback) {
                window.setTimeout(callback, 1000 / 60);
            };
})();
window.cancelAnimationFrame = ( function() {
    return window.cancelAnimationFrame ||
        window.webkitCancelRequestAnimationFrame ||
        window.mozCancelRequestAnimationFrame ||
        window.oCancelRequestAnimationFrame ||
        window.msCancelRequestAnimationFrame ||
        clearTimeout;
} )();


function a(){
    console.log('1');
    requestAnimationFrame(a);
}
a();
function b(){
    console.log('2');
    requestAnimationFrame(b);
}
b();
function c(){
    console.log('3');
    requestAnimationFrame(c);
}
c();
function d(){
    console.log('4');
    requestAnimationFrame(d);
}
d();
function e(){
    console.log('5');
    requestAnimationFrame(e);
}
e();
function f(){
    console.log('6');
    requestAnimationFrame(f);
}
f();
function g(){
    console.log('7');
    requestAnimationFrame(g);
}
g();